class VersionModel {
  final int code;
  final String msg;
  final NewVersionModel? data;

  VersionModel({
    required this.code,
    required this.msg,
    this.data,
  });

  factory VersionModel.fromJson(Map<String, dynamic> json) {
    return VersionModel(
      code: json['code'] ?? 0,
      msg: json['msg'] ?? '',
      data: json['data'] != null ? NewVersionModel.fromJson(json['data']) : null,
    );
  }
}

class NewVersionModel {
  /// 0 是首页，1 是设置页
  final int reminderType;

  /// 0 是不强制更新，1 是强制更新
  final int forcedUpdate;
  final String pushTitle;
  final String pushText;
  final String upgradeButton;
  final String cancelButton;
  final String version;

  NewVersionModel({
    required this.reminderType,
    required this.forcedUpdate,
    required this.pushTitle,
    required this.pushText,
    required this.upgradeButton,
    required this.cancelButton,
    required this.version,
  });

  factory NewVersionModel.fromJson(Map<String, dynamic> json) {
    return NewVersionModel(
      reminderType: json['reminderType'] ?? 0,
      forcedUpdate: json['forcedUpdate'] ?? 0,
      pushTitle: json['pushTitle'] ?? '',
      pushText: json['pushText'] ?? '',
      upgradeButton: json['upgradeButton'] ?? '',
      cancelButton: json['cancelButton'] ?? '',
      version: json['version'] ?? '',
    );
  }
}
